<!DOCTYPE html>
<html lan="zh-CN" ng-app="app">
<head>
<meta charset="utf-8">
<title>调查</title>
<link rel="stylesheet" href="css/main.css?v=1">
<link rel="stylesheet" href="css/font-awesome.min.css?v=1">
<link rel="stylesheet" href="css/jqueryui.css?v=1">
<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="js/jqueryui-min.js" type="text/javascript"></script>
<script src="js/angular.min.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
</head>
<body ng-controller="main">
	<div class="designer-header">
		<a href="###" class="fn-left build-back">返回</a>
		<div class="survey-step fn-left">
            <a class="designer-nav active" href="##"><i class="mh1"></i>设计</a>
            <a class="designer-nav " href="##"><i class="m2"></i>发布</a>
            <a class="designer-nav " href="##"><i class="m3"></i>报表</a>
        </div>
        <div class="survey-title fn-left">
            <div class="title-old" ng-show="oldTitleState">
            	<span class="title">{{diaochaTitle}}</span>
            	<a href="javascript:;" ng-click="changeTitle()"><i class="icon-edit"></i></a>
            </div>
            <div class="title-new" ng-show="newTitleState">
              <input type="text" value="{{diaochaTitle}}" ng-model="newTitle" ng-change="updateTitle(newTitle)" style="width: 360px">
              
              <button type="button" class="btn title-cancel" ng-click="cancelTitle()">取消</button>
             
              <button type="button" class="btn btn-primary  title-submit" ng-click="saveTite()">确认</button>
            </div>
        </div>
        <div class="survey-btn fn-right">
            <a href="##" class="survey-word"></a>&nbsp;&nbsp;&nbsp;
            <a class="btn btn-blank" href="javascript:;"style="width:60px;">预览</a>&nbsp;&nbsp;&nbsp;
            <a href="###" class="btn btn-primary" style="width:60px;">逻辑设置</a>&nbsp;&nbsp;&nbsp;
        </div>
	</div>
    <div id="survey-build">
        <div id="build-box" class="fn-clear">
            <div id="build-left">
                <div id="question-type-box">
                    <h5>基本题型</h5>
                    <ul>
                       <li class="move" data-type="radio" >
                           <a href="javascript:;" ng-click="addRadio()"><img src="img/question/a1.png">单选题</a>
                       </li> 
                       <li class="move" data-type="check">
                           <a href="javascript:;" ng-click="addCheckbox()"><img src="img/question/a2.png">多选题</a>
                       </li> 
                       <li class="move" data-type="select">
                           <a href="javascript:;" ng-click="addSelect()"><img src="img/question/a3.png">下拉题</a>
                       </li> 
                       <li class="move" data-type="input">
                           <a href="javascript:;" ng-click="addInput()"><img src="img/question/a4.png">填空题</a>
                       </li> 
                       <li class="move" data-type="page">
                           <a href="javascript:;" ng-click="addPage()"><img src="img/question/a8.png">分页符</a>
                       </li> 
                    </ul>
                </div>
            </div>
            <div id="build-right">
                <div id="question-wrap" class="fn-clear">
                    <ul id="question-box">
                      <li ng-class="{active: currentItem==item}" ng-repeat="item in items">
                        <div class="question-title" ng-if="item.type!='page'">
                          <b class="question-code">{{item.number}}.</b>
                          <div class="question-question">{{item.title}}</div>
                        </div>
                        <div class="question-title" ng-click="selectItem(item)" ng-if="item.type=='page'">
                          <div class="question-split">
                            <hr>
                            <div>
                              分页符
                            </div>
                          </div>
                        </div>
                        <div class="question-answer" ng-click="selectItem(item)"  ng-if="item.type!='page'">
                          <ul ng-class="item.lineStyle" ng-if="item.type!='input'">
                            <li ng-if="item.type=='radio'" class="read-radio" ng-repeat="xx in item.options">{{xx.title}}</li>
                            <li ng-if="item.type=='check'" class="read-check" ng-repeat="xx in item.options">{{xx.title}}</li>
                          </ul>
                          <div ng-if="item.type=='input'">    
                            <b class="read-input"></b>
                            <span class="suffix"></span>
                          </div>
                          <div ng-if="item.type=='select'">    
                              <b class="read-select"> - 请选择 - </b>
                              <ul class="select-box">
                                <li ng-repeat="xx in item.options">{{xx.title}}</li>
                              </ul>
                          </div>
                        </div>
                        <div class="question-action" ng-show="currentItem == item">
                          <a class="build-icon-minus" ng-click="deleteItem(item)" title="删除"></a>
                          <a class="build-icon-copy" ng-click="cloneItem(item, $$index)" title="复制"></a>
                        </div>
                      </li>
                    </ul>
                </div>
                <div id="question-edit-box">
                    <div id="question-edit" ng-show="currentItem != null">
                      <fieldset ng-if="currentItem.type!='page'">
                        <legend>
                         题号 <input type="text" id="" value="Q1" class="input-mini qcode" oncontextmenu="return false;" maxlength="8" ng-model="currentItem.number"> 由字母、_、数字组成，首位字母
                        </legend>
                        <div id="editor-bar">
                          <button class="btn btn-primary btn-mini"><i class="icon-font"></i>&nbsp;编辑文字内容</button>
                        </div>
                        <textarea class="question-text" ng-model="currentItem.title" placeholder="在这里输入你的问题"></textarea>
                      </fieldset>
                      <div class="question-type fn-clear" ng-if="currentItem.type=='radio' || currentItem.type=='select' || currentItem.type=='check'">
                        <fieldset>
                          <legend>变更题型</legend>
                          <select id="qtype" ng-options="itemType.type as itemType.title for itemType in itemTyps" ng-model="currentItem.type">
                          </select>
                        </fieldset>
                        <fieldset>
                          <legend>选项排列</legend>
                          <select ng-options="xx.cssName as xx.display for xx in lineStyles" ng-model="currentItem.lineStyle"></select>
                        </fieldset>
                      </div>
                      <fieldset id="option-box" ng-if="currentItem.type=='radio'|| currentItem.type=='select' || currentItem.type=='check'">
                        <table class="table table-bordered data-table">
                          <thead>
                            <tr>
                              <th>编码</th>
                              <th>答案</th>
                              <th width="45">操作</th>
                            </tr>
                          </thead>
                          <tbody class="ui-sortable">
                            <tr ng-repeat="xx in currentItem.options">
                              <td>
                                <input type="text" class="ocode" oncontextmenu="return false;" maxlength="5" value="1" ng-model="xx.id"/>
                              </td>
                              <td>
                                <input type="text" class="option-txt" ng-model="xx.title">
                              </td>
                              <td>
                                <a href="javascript:void(0);" ng-click="addOption(xx)" class="text-success">
                                  <i class="icon-plus-sign"></i>
                                </a>
                                <a href="javascript:void(0);" ng-click="delOption(xx)" class="text-warning">
                                  <i class="icon-minus-sign"></i>
                                </a>
                                <a href="javascript:void(0);" class="text-info option-move">
                                  <i class="icon-move"></i>
                                </a>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </fieldset>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

